<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "product".
 *
 * @property string $id ID
 * @property string $name 商品名称
 * @property string $image 商品图片
 * @property int $category_id 分类ID
 * @property int $created_at 创建时间
 * @property int $is_hot 是否热门
 * @property int $is_search 热门搜索
 */
class Product extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'product';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['category_id', 'created_at','name', 'image','is_hot','is_search'], 'required'],
            [['name'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '商品名称',
            'image' => '商品图片',
            'category_id' => '分类ID',
            'is_hot'=>'是否热门',
            'is_search'=>'热门搜索',
            'created_at' => '创建时间',
        ];
    }
}
